import { getRanks } from "./src/B站全部区排行.js";
import { getAnimes } from "./src/B站番剧信息.js";
import { getSearchResult, getSearchResultAPI } from "./src/B站搜索信息.js";
import { getUPPicbook } from "./src/UP主相簿信息.js";
import { getUPVideo } from "./src/UP主视频信息.js";
import { BVtoAV } from "./src/BVToAV.js";
import { getComments } from "./src/视频评论区.js";
import { getVideosInfo } from "./src/B站视频信息.js";

async function init() {
    // 爬虫的前置操作注入
    window.JSpider = (await import("https://cdn.jsdelivr.net/npm/js-spider@2.0.7/JSpider.js")).default;
    window.spider = new JSpider();
    await spider.Script("https://cdn.jsdelivr.net/gh/SheetJS/sheetjs/dist/xlsx.full.min.js");

    window["_Bilibili"] = {
        全站排名获取: getRanks,
        全部番剧信息收集: getAnimes,
        在站内搜索: getSearchResult,
        UP主相簿信息: getUPPicbook,
        UP主视频信息: getUPVideo,
        BV转AV: BVtoAV,
        某视频的评论区: getComments,
        某些视频的信息: getVideosInfo,
    };
    Object.assign(window["_Bilibili"], { getVideosInfo, getComments, BVtoAV, getSearchResultAPI, getRanks, getAnimes, getSearchResult, getUPPicbook, getUPVideo });
    console.log("初始化成功");
}
init();
export {};
